package com.song.service;

import com.song.entity.Book;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author 宋伟宁
 * @Date 2024/1/2
 * @Version 1.0
 **/
@FeignClient(name = "BOOK-SERVICE")
public interface BookService {

      @GetMapping("/book/")
      List<Book> books();

      @DeleteMapping("/book/{id}")
      boolean delete(@PathVariable("id") int id);

      @PostMapping("/book/")
      boolean add(@RequestBody Book book);

      @PutMapping("/book/")
      boolean update(@RequestBody Book book);

      @GetMapping("/book/{id}")
      Book findOne(@PathVariable("id") int id);

}
